{extend name="../application/public/base.html" /}
{block name="head"}
	<link rel="stylesheet" href="ADMIN_CUSTOM/css/list.css">
    <link rel="stylesheet" href="ADMIN_CUSTOM/css/btn.css">
{/block}
{block name="body"}
    <body>
        <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a><cite>导航元素</cite></a>
          </span>
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right;" onclick="location.reload()" title="刷新"><i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <!-- 查询 start -->
                        	<div class="layui-card-body">
	                            <form class="layui-form layui-col-space20">
	                            	<input type="hidden" name="ids" value="{:Request()->param('ids')}">
	                            	<div class="layui-input-inline layui-show-xs-block">
										<label>产品分类</label>
									 	<div class="layui-input-inline">
										  	<select name="category_id" class="layui-select" lay-filter="select">
		                                        <option value="">全部</option>
		                                        {volist name="cate" id="v"}
		                                        <option value="{$v.category_id}">{$v.category_name}</option>
		                                        {/volist}
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
										<label>产品子分类</label>
									 	<div class="layui-input-inline">
										  	<select name="cat_id" class="layui-select" lay-filter="select">
		                                        
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
										<label>产品品牌</label>
									 	<div class="layui-input-inline">
										  	<select name="brand_name" class="layui-select" lay-filter="select">
		                                        
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block" lay-filter="select">
										<label>产品内存</label>
									 	<div class="layui-input-inline">
										  	<select name="memory_name" class="layui-select" lay-filter="select">
		                                        
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
										<label>产品属性</label>
									 	<div class="layui-input-inline">
										  	<select name="attribute_name" class="layui-select" lay-filter="select">
		                                       
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
										<label>产品颜色</label>
									 	<div class="layui-input-inline">
										  	<select name="colour_name" class="layui-select" lay-filter="select">
		                                        
		                                   	</select>
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
									 	<div class="layui-input-inline">
										  	<input type="text" id="start" placeholder="开始日" name="start" autocomplete="off" class="layui-input">
									  	</div>
									  	<div class="layui-input-inline">
										  	<input type="text" id="end" placeholder="结束日" name="end" autocomplete="off" class="layui-input">
									  	</div>
							     	</div>
							     	<div class="layui-input-inline layui-show-xs-block">
									 	<div class="layui-input-inline keyword-search">
										  	<input type="text" placeholder="请输入关键字进行搜索" name="keyword" autocomplete="off" class="layui-input">
									  	</div>
							     	</div>
	                                <div class="layui-input-inline layui-show-xs-block">
	                                    <div class="layui-btn" lay-submit="" lay-filter="sreach">
	                                        <i class="layui-icon">&#xe615;</i></div>
	                                </div>
	                            </form>
	                        </div>
	                        <!-- 查询 end -->

	                        <!-- 统计 start -->
	                        <div class="layui-card-body" id="order-count">

	                        </div>	
	                        <!-- 统计 end -->

	                        <!-- 表格 start -->
	                        <div class="layui-tab layui-tab-card zcc-table-box" style="margin-bottom:15px;" id="order-list">
							  	
							</div>
						  	<!-- 表格 start -->

						  	<!-- 分页 start -->
							<div class="layui-card-body ">
	                            <div class="page" id="page">
	                                
	                            </div>
	                        </div>
	                        <!-- 分页 start -->
                        </div>
                    </div>
                </div>
            </div>
        </div> 
    </body>
{/block}
{block name="script"}  
	<script type="text/javascript" src="ADMIN_CUSTOM/js/staff/order/index.js"></script>
	<!-- 列表模版 -->
	<script id="order_list" type="text/html">
		{{#  layui.each(d.list.data, function(index, item){ }}
		<ul class=" zcc-title-ul">
			<li>订单编号：{{item.order_sn}}</li>
			<li>订单时间：{{item.addtime}}</li>
			<li>客户姓名：{{item.username}}</li>
			<li>联系方式：{{item.phone}}</li>
			<li>客户编号：{{item.user_sn}}</li>
			<li>营业员：{{item.nkname}}</li>
			<li>订单金额(元)：{{item.order_money}}</li>
			<li>未付款金额(元)：{{item.stay_money}}</li>
	  	</ul>
	  	<div class="layui-tab-content">
			<table class="layui-table layui-form zcc-table">
			  	<thead>
					<tr>
						<th>序号</th>
						<th>产品编码</th>
						<th>产品名称</th>
						<th>IEMI</th>
						<th>S/N</th>
						<th>合同编号</th>
						<th>数量</th>
						<th>单位</th>
						<th>售出价格（元）</th>
						<th>进货价格（元）</th>
						<th>状态</th>
					</tr>
			  	</thead>
			  	<tbody>
			  		{{#  layui.each(item.goods, function(index2, goods){ }}
					
					{{# if(goods.is_show == 0){ }}
					<tr>
					{{# }else if(goods.is_show == 1){ }}
					<tr style="color: #A13933;">
					{{# }else{ }}
					<tr style="color: #00CC00;">
					{{# } }}
						<td>{{index2+1}}</td>
						<td>{{goods.goods_sn}}</td>
						<td>{{goods.gname}}</td>
						<td>{{goods.imei}}</td>
						<td>{{goods.sn}}</td>
						<td>{{goods.contract_sn}}</td>
						<td>{{goods.number}}</td>
						<td>{{goods.unit}}</td>
						{{# if(goods.price_type == 0){ }}
						<td>{{goods.selling_price}}</td>
						{{# }else{ }}
						<td>{{goods.trade_price}}</td>
						{{# } }}
						<td>{{goods.buying_price}}</td>
						<td>{{goods.is_show_text}}</td>
                	</tr>
	  				{{# }) }}
			  	</tbody>
			</table>
			<a class="layui-col-space10" href="javascript:;" onclick="xadmin.open('订单详情','/user/order/details/ids/{{item.order_id}}','','',true)" style="color: #009688;">
				<span>查看</span>
				<span>>></span>
			</a>
	  	</div>
	  		
		{{# }) }}
	</script>
 	<!-- 统计模版 -->
 	<script id="order_count" type="text/html">
		<div class="green-border-btn">销售订单数：{{d.consum.order_num}}</div>
		<div class="green-border-btn">销售总额：{{d.consum.order_money}}元</div>
		<div class="green-border-btn">销售总成本：{{d.consum.buying}}元</div>
		<div class="green-border-btn">销售总盈利：{{d.consum.sale}}元</div>
 	</script>
 	<!-- 分页模版 -->
 	<script id="page_demo" type="text/html">
 		{{# if(d.list.total > 0){ }}
 		<div>
          	
          	{{# if(d.list.per_page == d.list.current_page ){ }}
			<a class="prev" style="cursor: not-allowed;">上一页</a>
          	{{# }else{ }}
			<a class="prev" href="javascript:;" onclick="page({{d.list.per_page}})">上一页</a>
          	{{# } }}

          	{{# for(var i = 1; i <= d.list.total; ++i){ }}
          		{{# if(i == d.list.current_page ){ }}
				<span class="current">{{i}}</span>
				{{# }else{ }}
				<a class="num" href="javascript:;" onclick="page({{i}})">{{i}}</a>
				{{# } }}
          	{{# } }}
          	{{# if(d.list.last_page == d.list.current_page ){ }}
			<a class="next" href="javascript:;" style="cursor: not-allowed;">下一页</a>
          	{{# }else{ }}
			<a class="next" href="javascript:;" onclick="page({{d.list.last_page}})">下一页</a>
          	{{# } }}
          	
        </div>
        {{# } }}
 	</script>
{/block}